package com.zhuxiaomei.mapper;

import com.zhuxiaomei.annotation.AutoFill;
import com.zhuxiaomei.entity.restaurant.RestaurantOrder;
import com.zhuxiaomei.enumeration.OperationType;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/**
 * @author hxm
 * @date 2025/1/1 12:58
 * @description
 */
public interface RestaurantOrderMapper extends Mapper<RestaurantOrder> {
    @AutoFill(OperationType.INSERT)
    void insertNewOrder(RestaurantOrder restaurantNewOrder);

    @AutoFill(OperationType.UPDATE)
    void updateByOrderNo(RestaurantOrder restaurantOrder);

    @Select("select * from restaurant_orders where order_no = #{orderNo}")
    RestaurantOrder selectByOrderNo(@Param("orderNo") String orderNo);
}
